/*
 * @Author: sbotlp
 * @Email: sbotlp@sina.com
 * @Date: 2019-11-06 22:27:22
 * @LastEditTime: 2019-11-06 23:25:22
 * @Description: http://www.sbotlp.com.cn
 */
(function(window) {
  var zepto ={};
  function Z(dom, selector) {
    var i, len = dom? dom.length : 0;
    for ( i = 0; i < len; i++) {
      this[i]=dom[i];
    }
    this.length = len;
    this.selector = selector|| '';
  }
  var $ = function(selector){
    return zepto.init(selector);
  }
  zepto.init =function(selector) {
    var slice = Array.prototype.slice;
    var dom = slice.call(document.querySelectorAll(selector));
    return zepto.Z(dom,selector);
  }
  zepto.Z = function(dom, selector) {
    return new Z(dom, selector)
  }
  window.$ = $;
  $.fn = {
    css: function (key,value) {
      var i =0;
      for (i = 0; i < this.length; i++) {
        this[i].setAttribute('style', `${key}:${value}`);
      }
    },
    html: function() {
      return document.querySelector(this.selector).innerHTML;
    }
  }
  zepto.prototype=Z.prototype=$.fn;
})(window)